package code;

public enum Direction
{
	UP(new Orientation() {
		public Cell returnNeighbour(Cell t) {
			return t.getTop();
		}
	}),
	DOWN(new Orientation() {
		public Cell returnNeighbour(Cell t) {
			return t.getBottom();
		}
	}),
	RIGHT(new Orientation() {
		public Cell returnNeighbour(Cell t) {
			return t.getRight();
		}
	}),
	LEFT(new Orientation() {
		public Cell returnNeighbour(Cell t) {
			return t.getLeft();
		}
	});
	
	private Orientation orientation;
	
	private Direction(Orientation orientation)
	{
		this.orientation = orientation;
	}
	
	public Cell getNeighbour(Cell t)
	{
		return orientation.returnNeighbour(t);
	}
}
